﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChatModel : MonoBehaviour
{
    public GameObject ExpressionBtn;
    public GameObject ChatBtn;
    public GameObject Information;//聊天界面
    public GameObject FaceTextTable;//表情界面
    public GameObject Collider;

    void Awake()
    {
        UIEventListener.Get(ExpressionBtn).onClick = (OnClick);
        UIEventListener.Get(ChatBtn).onClick = (OnClick);
        UIEventListener.Get(Collider).onClick = (OnClick);
    }

    void OnClick(GameObject button)
    {
        if (button.name == "ExpressionBtn")
        {
            Information.gameObject.SetActive(false);
            FaceTextTable.gameObject.SetActive(true);
        }
        else if (button.name=="ChatBtn")
        {
            Information.gameObject.SetActive(true);
            FaceTextTable.gameObject.SetActive(false);
        }
        else if (button.name == "Collider")
        {
            Destroy(gameObject);
        }

    }
}
